//
//  ZMyOrderShopInfoTopCell.m
//  DistributorAB
//
//  Created by LZY on 2019/10/14.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "ZMyOrderShopInfoTopCell.h"
@interface ZMyOrderShopInfoTopCell ()
@property (nonatomic, strong) UILabel *lblShopName;//店铺名称
@end

@implementation ZMyOrderShopInfoTopCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupViewAction];
    }
    return self;
}
#pragma mark - 界面布局
- (void)setupViewAction{
    UIImageView *ivShop = [[UIImageView alloc] initWithFrame:CGRectMake(16, 16, 16, 16)];
    ivShop.image = imgname(@"shop_small_green_icon");
    [self.contentView addSubview:ivShop];
    
    _lblShopName = [UILabel new];
    _lblShopName.font = [UIFont systemFontOfSize:14];
    _lblShopName.textAlignment = NSTextAlignmentLeft;
    _lblShopName.textColor = kColorWithHex(0x70be68);
    [self.contentView addSubview:_lblShopName];
    [_lblShopName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.contentView.mas_leading).offset(33);
        make.top.equalTo(self.contentView.mas_top).offset(14);
        make.height.mas_equalTo(20);
    }];
    
}
- (void)setModel:(ZMyOrderCarOrderModel *)model{
    if (model) {
        _model = model;
        _lblShopName.text = model.factory_name;
    }
}
- (void)setOrderModel:(ZMyOrderListOrderModel *)orderModel{
    if (orderModel) {
        _orderModel = orderModel;
        _lblShopName.text = orderModel.factory_name;
        
        UIImageView *ivArrow = [UIImageView new];
        ivArrow.image = imgname(@"arrow_right_icon");
        [self.contentView addSubview:ivArrow];
        [ivArrow mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.lblShopName.mas_centerY);
            make.leading.equalTo(self.lblShopName.mas_trailing).offset(16);
            make.size.mas_equalTo(CGSizeMake(6, 12));
        }];
    }
}
+ (CGFloat)cellHeight{
    return 34.0;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
